package com.hd.trans.utils;

import android.annotation.SuppressLint;

import java.text.SimpleDateFormat;
import java.util.Date;

@SuppressLint("SimpleDateFormat")
public class DateUtil {
	
	private DateUtil(){
	}
	
	public static String getCommTimeStr2(long milliseconds) {
		return getFormatStr(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"), milliseconds);
	}

	public static String getDateStr3(long milliseconds) {
		return getFormatStr(new SimpleDateFormat("yyyyMMdd"), milliseconds);
	}

	/** 毫秒数转日期字符串 **/
	public static String getFormatStr(SimpleDateFormat format, long milliseconds) {
		Date date = new Date();
		date.setTime(milliseconds);
		return format.format(date);
	}

}
